package net.roobook.server.test.service;

import net.roobook.common.entity.RoobookServerConstant;
import net.roobook.server.test.service.fallback.HelloServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
// @FeignClient注解标注表明这是一个Feign Client
// value指定远程服务的名称,spring.application.name的配置,即注册到Eureka里的服务名称
// contextId指定这个Feign Client的别名
// fallbackFactory指定了回退方法，当我们调用远程服务出现异常时，就会调用这个回退方法
@FeignClient(value = RoobookServerConstant.SERVER_SYSTEM, contextId = "helloServiceClient", fallbackFactory = HelloServiceFallback.class)
public interface IHelloService {
    @GetMapping("hello")
    String hello(@RequestParam("name") String name);
}
